package com.imcode;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class PokerV1 {
    /**
    public static void main(String[] args) {
        //1.生成扑克牌
        //1.1 定义花色的集合
        List<String> colors = new ArrayList<>();
        Collections.addAll(colors, "♥", "♦", "♠", "♣");
        //1.2 定义牌面的集合
        List<String> numbers = new ArrayList<>();
        //1.3 生成扑克牌
        Collections.addAll(numbers, "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K");
        // 定义存储扑克牌的集合
        List<String> pokerBox = new ArrayList<>();
        for (String color : colors) {
            for (String number : numbers) {
                //System.out.print(color + number + " ");
                pokerBox.add(color + number);
            }
            //System.out.println();
        }
        // 添加大王和小王
        pokerBox.add("大王");
        pokerBox.add("小王");

        //2.洗牌
        Collections.shuffle(pokerBox);
//        System.out.println("-----------------------");
//        for (int i = 1; i <= pokerBox.size(); i++) {
//            System.out.print(pokerBox.get(i - 1) + "\t");
//            if (i > 1 && i % 13 == 0) {
//                System.out.println();
//            }
//        }

        //3.发牌
        List<String> play1 = new ArrayList<>();
        List<String> play2 = new ArrayList<>();
        List<String> play3 = new ArrayList<>();
        List<String> dipai = new ArrayList<>();
        for (int i = 1; i <= pokerBox.size(); i++) {
            if (i > 51) {
                dipai.add(pokerBox.get(i - 1));
            } else {
                if (i % 3 == 1) {
                    play1.add(pokerBox.get(i-1));
                }else  if(i % 3 ==2){
                    play2.add(pokerBox.get(i-1));
                }else{
                    play3.add(pokerBox.get(i-1));
                }
            }
        }
        System.out.println("玩家一:" + play1);
        System.out.println("玩家二:" + play2);
        System.out.println("玩家三:" + play3);
        System.out.println("底牌:" + dipai);
    }**/
}